package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-07-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_currency_record")
public class GuCurrencyRecord extends Model<GuCurrencyRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "cr_id", type = IdType.AUTO)
    private Long crId;

    /**
     * 用户id
     */
    private Long crUserId;

    /**
     * steamId
     */
    private String crSteamId;

    /**
     * 用户名
     */
    private String crUserNickname;

    /**
     * 金额
     */
    private BigDecimal crAmount;

    /**
     * 原始金额
     */
    private BigDecimal crOriginalAmount;

    /**
     * 0 获得 1 使用
     */
    private Integer crType;

    /**
     * 1 充值 2 分红 3 填写邀请码 4 兑换 5 孵化 6 开箱子
     */
    private Integer crSourceType;

    /**
     * 来源id
     */
    private Long crSourceId;

    /**
     * 图片
     */
    private String crSourceImage;

    /**
     * 名称
     */
    private String crSourceName;

    /**
     * 描述
     */
    private String crDesc;

    /**
     * 备注
     */
    private String crRemark;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime crCreateTime;


    @Override
    protected Serializable pkVal() {
        return this.crId;
    }

}
